//第一种方式引入组件
import Home from "../views/Home.vue"
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
//配置相关的路由信息  元数据
const routes = [
    {
        path: '/',
        redirect:'/miapp',
        name: 'home',
        component: Home,
        meta:{title:'首页'}
    },
    {
        path: '/find',
        name: 'find',
        component: () => import('../views/Find.vue'),
        meta: { title: '发现音乐' },
        children: [
            {
                path: 'discover',
                name: 'discover',
                component: () => import('../views/find/Discover.vue'),
                meta: { title: '推荐音乐' },
               
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/Login.vue'),
        meta:{title:'登录'}
    },
    {
        path: '/my',
        name: 'my',
        component: () => import('../views/My.vue'),
        meta: { title: '我的音乐' }
    },
    {
        path: '/friend',
        name: 'friend',
        component: () => import('../views/Friend.vue'),
        meta: { title: '我的关注' }
    },
    {
        path: '/musician',
        name: 'musician',
        component: () => import('../views/Musician.vue'),
        meta: { title: '音乐人' }
    },
    {
        path: '/tjmove',
        name: 'tjmove',
        component: () => import('../views/tabs/Tjmove.vue'),
        meta: { title: '推荐' }
    },
    {
        path: '/prodetial',
        name: 'prodetial',
        component: () => import('../views/moveshop/Prodetial.vue'),
        meta: { title: '商品详情' }
    },
    {
        path: '/miapp',
        name: 'miapp',
        component: () => import('../views/moveshop/Miapp.vue'),
        meta: { title: '商品详情' }
    },
]

//创建router实例
const router = createRouter({
    history: createWebHistory(),
    routes
})

//导出router实例
export default router
